Fix idle pool cleaner generation race - #2289
Closed
pavel-ptashyts wants to merge 4 commits into
Closed
Conversation
Claim the exact idle generation evaluated by the cleaner so a lease and re-offer cannot turn a stale expiry decision into a close of the fresh entry. Keep generation and ownership in one CAS-able state to preserve the per-channel allocation model and avoid hiding a newer entry from poll. Fixes AsyncHttpClient#2284 Codex on behalf of Pavel Ptashyts Co-Authored-By: Codex <codex@openai.com>
hyperxpro
requested changes
Jul 25, 2026
Make pool offers transfer an owned idle generation with CAS so duplicate or concurrent offers cannot reset a leasable generation with a non-atomic update. Clarify generation encoding and snapshot claim naming, and exercise the cleaner retention and close paths end to end. Refs AsyncHttpClient#2284 Codex on behalf of Pavel Ptashyts Co-Authored-By: Codex <codex@openai.com>
hyperxpro
requested changes
Jul 25, 2026
Prevent duplicate or delayed offers from transferring a newer idle generation. A reset-in-progress state now binds the timestamp update to the exact owned snapshot without serializing reset calls. Treat duplicate offers as accepted no-ops, defer partition creation until a real insertion, and exercise the cleaner with a neighboring live entry. Refs AsyncHttpClient#2284 Codex on behalf of Pavel Ptashyts Co-Authored-By: Codex <codex@openai.com>
Member
|
This is going to be a lot of back and forth since this is a complicated - I will close and handle it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #2284
Testing
./mvnw -pl client -Dtest=DefaultChannelPoolTest test(19 tests passed)./mvnw clean verifyattempt: 1,326 tests passed and one unrelated timing assertion failed inSemaphoreTest.combinedCheckAcquireTimeSemaphoreTestrerun passed (10/10)Codex on behalf of Pavel Ptashyts